
/*
 +------------------------------------------------------------------------+
 | Phalcon Framework                                                      |
 +------------------------------------------------------------------------+
 | Copyright (c) 2011-2017 Phalcon Team (https://phalconphp.com)          |
 +------------------------------------------------------------------------+
 | This source file is subject to the New BSD License that is bundled     |
 | with this package in the file LICENSE.txt.                             |
 |                                                                        |
 | If you did not receive a copy of the license and are unable to         |
 | obtain it through the world-wide-web, please send an email             |
 | to license@phalconphp.com so we can send you a copy immediately.       |
 +------------------------------------------------------------------------+
 | Authors: Andres Gutierrez <andres@phalconphp.com>                      |
 |          Eduar Carvajal <eduar@phalconphp.com>                         |
 +------------------------------------------------------------------------+
 */

namespace Phalcon;

/**
 * Phalcon\Acl
 *
 * This component allows to manage ACL lists. An access control list (ACL) is a list
 * of permissions attached to an object. An ACL specifies which users or system processes
 * are granted access to objects, as well as what operations are allowed on given objects.
 *
 *<code>
 * use Phalcon\Acl;
 * use Phalcon\Acl\Role;
 * use Phalcon\Acl\Resource;
 * use Phalcon\Acl\Adapter\Memory;
 *
 * $acl = new Memory();
 *
 * // Default action is deny access
 * $acl->setDefaultAction(Acl::DENY);
 *
 * // Create some roles
 * $roleAdmins = new Role("Administrators", "Super-User role");
 * $roleGuests = new Role("Guests");
 *
 * // Add "Guests" role to acl
 * $acl->addRole($roleGuests);
 *
 * // Add "Designers" role to acl
 * $acl->addRole("Designers");
 *
 * // Define the "Customers" resource
 * $customersResource = new Resource("Customers", "Customers management");
 *
 * // Add "customers" resource with a couple of operations
 * $acl->addResource($customersResource, "search");
 * $acl->addResource($customersResource, ["create", "update"]);
 *
 * // Set access level for roles into resources
 * $acl->allow("Guests", "Customers", "search");
 * $acl->allow("Guests", "Customers", "create");
 * $acl->deny("Guests", "Customers", "update");
 *
 * // Check whether role has access to the operations
 * $acl->isAllowed("Guests", "Customers", "edit"); // Returns 0
 * $acl->isAllowed("Guests", "Customers", "search"); // Returns 1
 * $acl->isAllowed("Guests", "Customers", "create"); // Returns 1
 *</code>
 */
abstract class Acl
{
	const ALLOW = 1;

	const DENY = 0;
}
